<template>
  <div>
    <keep-alive>
      <index v-if="status"></index>
      <index1 v-else></index1>
    </keep-alive>
    <button @click="changeStatus">切换</button>
  </div>   
</template>

<script>
import index from "@/components/Mi/index.vue";
import index1 from "@/components/Mi/index1.vue";
export default {
  data() {
    return {
      status: false,
    };
  },
  components: {
    index,
    index1,
  },
  methods: {
    changeStatus() {
      this.status = !this.status;
    },
  },
};
</script>

<style>


</style>
